package com.itheima.reggie.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.reggie.dto.DishDto;
import com.itheima.reggie.pojo.Dish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface DishMapper extends BaseMapper<Dish> {
    /**
     * 分页查询
     * @param dishDtoPage
     * @param name
     * @return
     */
    Page<DishDto> pageDishDto(
            @Param("page") Page<DishDto> dishDtoPage,
            @Param("name") String name);

    /**
     * 根据ID查询数据回显
     * @param id
     * @return
     */
    DishDto updateFlavor(Long id);

    /**
     * 查询菜品详情信息
     * @param categoryId
     * @param name
     * @return
     */
    List<DishDto> listDishDto(@Param("categoryId") Long categoryId,
                              @Param("name") String name);
}
